{% set clazz = "addresses" %}
{% set title = "选择收货地址" %}
{% extends './modules/common/templates/main.html' %}
{% block style %}
  <link rel="stylesheet" type="text/css" href="{{ '/static/css/integral.css'|version }}" />
{% endblock %}
{% block content %}
  {% if !nested %}
    <header class="bar bar-header">
      {{ macro.back() }}
      <h1 class="title">{{ title }}</h1>
    </header>
  {% endif %}
  <section class="has-footer">
    {% if list.length %}
      <div class="list">
        {% for item in list %}
          <a class="item" href="/integral/address/choose/{{ item.id }}">
            <i class="icon text-orange">&#xe60d;</i>
            <span class="text">
              {{ item.name }} <span class="text-sm text-gray">{{ item.mobile }}</span>
              <p class="brief"><span>地址：{{ item.address|default('暂未填写') }}</span></p>
            </span>
            <i class="icon text-gray">&#xe61a;</i>
          </a>
        {% endfor %}
      </div>
    {% else %}
      <div class="plate">
        <div class="draw">
          <img src="http://7xjyap.com2.z0.glb.qiniucdn.com/image-2f0df3ff-2a9a-4367-a7df-bd53231b0a9f.png" alt="空白" />
          <h4 class="title">还没有收货人哦，去添加一个吧！</h4>
          <div class="interact">
            <a href="/integral/address" class="button warning">前去添加</a>
          </div>
        </div>
      </div>
    {% endif %}
  </section>
  {% if list.length %}
    <footer class="bar bar-footer bar-fixed bar-flat">
      <a class="button warning square" href="/integral/address">新建</a>
    </footer>
  {% endif %}
{% endblock %}
{% block script %}{% endblock %}